<?php
  require_once('tpl/header.php');
?>

   <?php 
		// mysql_connect("localhost","root","");
		// mysql_select_db("neuvideo");
		// mysql_set_charset("utf8");

	require("inc_admin.php");
	connect();


		$typename=$_POST["typename"];
		
		$sql0="select * from videotype where typename='$typename'";
		$result0=mysql_query($sql0);//结果集类型
		$number0=mysql_num_rows($result0);//返回结果集中记录的条数
		if ($number0>0) 
		{
			echo "该类型已存在，3s后将返回！";
			//页面跳转
			header("refresh:3;url='typeAdd.php'");

		}
		else
		{
			$sql="insert into videotype values(null,'$typename') ";
			$result=mysql_query($sql);//结果集
        	if($result==1)
        	{
        		echo "视频类型添加成功，3s后返回视频类型列表页";
        		header("refresh:3;url='typeList.php'");
        	}    
        	else
        	{
        		echo "视频类型添加失败";
        	}
        }
	 ?>


<?php
  require_once('tpl/footer.php');
?>